package com.gdcp.util;

import com.gdcp.config.RequestHolder;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 杨华京
 * @version 1.0
 * @description
 * @since 1.8
 */
public class GetPcUtil {

    //获取当前页码
    public static int getPc(HttpServletRequest request) {
        int pc = 1;
        String param = request.getParameter("pc");
        if(param != null && !param.trim().isEmpty()) {
            try {
                pc = Integer.parseInt(param);
            } catch(RuntimeException e) {
                System.out.println("获取当前页码错误");
            }
        }
        //System.out.println(pc);
        return pc;
    }
}
